const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const scoreSchema = new mongoose.Schema({
  //试卷id
  testId: {
    type: Schema.Types.ObjectId,
    ref: "Test",
    required: [true, "you must tell us your  testId"],
  },
  //用户id
  userId: {
    type: Schema.Types.ObjectId,
    ref: "User",
    required: [true, "you must tell us your  userId"],
  },
  //成绩
  score: {
    type: String,
    default: null,
  },
});

const Score = mongoose.model("Score", scoreSchema);
module.exports = Score;
